package com.hbt.english.dao;

import com.hbt.api.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {

    public User getUserByCondition(User user);

    @Select("select *from users where username = #{username}")
    public User getUserByUsername(String username);

    @Select("select *from users where username = #{username} and password = #{password}")
    public User getUserByUsernameAndPassword(User user);

    @Update("update users set avatar=#{avatar} where username = #{username}")
    public int updateAvatarByUsername(User user);
}
